home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / src / PROGENV / OStruBrowser.h < prev    next >
C/C++ Source or Header  |  1992-06-09  |  3KB  |  105 lines

  1. #ifndef OStruBrowser_First
  2. #ifdef __GNUG__
  3. //pragma once
  4. #pragma interface
  5. #endif
  6. #define OStruBrowser_First
  7.  
  8. #include "GraphView.h"
  9. #include "EtPeTool.h"
  10.  
  11. class MenuBar;
  12. class Zoomer;
  13. class Menu;
  14.  
  15. //---- Object Structure Browser ------------------------------------------------
  16.  
  17. class PeObjectStructureView: public GraphView {
  18.     Object *currentOp;
  19.     Object *rootOp;
  20.     bool lines;
  21.     bool varNames;
  22.     
  23. private:
  24.     void SynchSelection();
  25.  
  26. public:
  27.     MetaDef(PeObjectStructureView);
  28.     PeObjectStructureView(EvtHandler*);
  29.     ~PeObjectStructureView();
  30.  
  31.     Object *GetRoot();
  32.     VObject *NodeAsVObject(Object*);
  33.     Iterator *MakeSubPartsIter(Object*);
  34.     Command *NodeSelected(VObject*, int cl);
  35.  
  36.     Command *DoMenuCommand(int cmd);
  37.     void DoSetupMenu(Menu *menu);
  38.     void SetSelection(VObject *gp);
  39.  
  40.     //---- queries 
  41.     bool CheckObject(Object*);
  42.     void EvtHandlers(Object*);
  43.     void Containers(Object*);
  44.     void Dependents(Object*);
  45.     void References(Object*);
  46.     void Pointers(Object*);
  47.     void ShowObject(Object*);
  48.     void ToggleShowLines();
  49.     
  50.     void LoadETGraph(Object *root);
  51. };
  52.  
  53. //---- ObjectBrowser ----------------------------------------------------
  54.  
  55. class PeObjectBrowser: public EtPeTool {
  56.     static PeObjectBrowser *objBrowser;
  57.     PeObjectStructureView *osv;
  58.     Zoomer *zoomer;
  59.     
  60. public:
  61.     MetaDef(PeObjectBrowser);
  62.     PeObjectBrowser(Manager *m);
  63.     ~PeObjectBrowser();
  64.     void ShowObject(Object *op);
  65.  
  66.     Point GetInitialWindowSize();
  67.     VObject *DoMakeContent();
  68.     MenuBar *DoMakeMenuBar();
  69.     
  70.     Command *DoMenuCommand(int cmd);
  71.     void DoSetupMenu(Menu *mp);
  72.  
  73.     static void Spawn(Manager *m, Object *op);
  74.     static void ShowObject(Manager *m, Object *op);
  75. };
  76.  
  77. //---- LabeledGraphReference ------------------------------------------------------------
  78.  
  79. class PeLabeledGraphReference: public GraphReference {
  80.     SeqCollection *labels;
  81. public:
  82.     PeLabeledGraphReference(GraphView *, Object *op, Collection *nodes, 
  83.            SeqCollection *labels, Ink *i, int width= 2, bool free= FALSE);
  84.     ~PeLabeledGraphReference();
  85.     void DrawConnection(int n, VObject *from, VObject *to);
  86. };
  87.  
  88. //---- NestedIter: iterate over a 0 terminated variable argument list of Objects
  89. //                 expanding Collections
  90.  
  91. class PeNestedIter : public Iterator {
  92.     Iterator *it, *subIter;
  93.     Collection *cont;
  94.     bool free;
  95. public:
  96.     PeNestedIter(Object *, Object *, ...);
  97.     PeNestedIter(Collection *, bool free);
  98.     ~PeNestedIter();
  99.     Object *operator()();
  100.     Collection *Coll();
  101.     void Reset();
  102. };
  103.  
  104. #endif
  105.